package com.tianhao.luo.sync;

/**
 * 验证synchronized是可重入锁
 *
 * @author tianhao.luo@hand-china.com
 */
public class ReentrantSyncLockDemo {
    public static void main(String[] args) {
        Object o = new Object();
        new Thread(()->{
            synchronized (o){
                System.out.println(Thread.currentThread().getName()+" a");

                synchronized (o){
                    System.out.println(Thread.currentThread().getName()+" b");
                }
            }
        }).start();
    }
}
